package com.lizhi.yun.core.login.controller;/**
 * @program: spring-boot
 * @name LoginController
 * @description: 用户登录controller
 * @author: lizhi
 * @create: 2020-04-11 17:24
 */

import com.lizhi.common.yun.entity.ListResponseResult;
import com.lizhi.yun.core.login.handler.LoginHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 *@program: spring-boot
 *@name LoginController
 *@description: 用户登录controller
 *@author: lizhi
 *@create: 2020-04-11 17:24
 */
@Slf4j
@RestController
@RequestMapping(value = "/api/upp/login")
public class LoginController {

    @Resource
    private LoginHandler loginHandler;

    /**
     *
     * @Author lizhi
     * @Description
     * @Date 17:25 2020/4/11
     * @Param  * @param null
     * @return
     **/
    @PostMapping(path = "/doLogin")
    public ListResponseResult doLogin(String userAcct, String password) {
        return loginHandler.doLogin(userAcct, password);
    }

    @PostMapping(path = "/doSignout")
    public ListResponseResult doSignout(String userAcct) {
        return loginHandler.doSignout(userAcct);
    }

    /**
     * 获取菜单
     *
     * @param userAcct
     * @return String
     */
    @PostMapping(path = "/doMenu")
    public ListResponseResult doMenu(String userAcct) {
        return loginHandler.doMenu(userAcct);
    }
}
